<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <h1>{{name1}}</h1>
        <h1>{{age+1}}</h1>
        <h1>{{say.toLowerCase()}}</h1>
        <!-- 双大括号可以书写Js表达式，表达式都有返回值 -->
        <h1>{{flag?name1:name2}}</h1>
        <!-- 双大括号不可以书写JS语句，报错 -->
        <!-- <h1>{{if(flag){name1}}}</h1> -->
    </div>
    <script>
        const vm = new Vue({
            el: "#app",
            data: {
                name1: "老李",
                name2: "老王",
                flag: false,
                age: 18,
                say: "hello"
            }
        })
    </script>
</body>

</html>